/*
 * GameScene.h
 *
 *  Created on: Oct 18, 2012
 *      Author: quyetnd
 */

#ifndef GAMESCENE_H_
#define GAMESCENE_H_
#include "cocos2d.h"
#include "../Layer/WaterLayer.h"
#include "../Layer/RoomLayer.h"

USING_NS_CC;

enum{
	kGameStateInRoom,
	kGameStateUnderWaterDown,
	kGameStateUnderWaterUp,
	kGameStateUnderWaterCaughtShark,
};

class GameScene : public CCScene, public CCStandardTouchDelegate, public CCAccelerometerDelegate, public CCKeypadDelegate{
protected:
	CCLayer* gameLayer;
	WaterLayer* waterLayer;
	RoomLayer* roomLayer;

	int gameStatus;
public:
	GameScene();
	virtual ~GameScene();

	virtual void loadResources();
	virtual void loadWater();
	virtual void loadRoom();

	/* update handle */
	void gameUpdateInRoom(float dt);
	void gameUpdateUnderWaterUp(float dt);
	void gameUpdateUnderWaterDown(float dt);
	void gameUpdateCaughtShark(float dt);

	/* Override */
	void onEnter();
	void onExit();
	void update(float dt);

	/* Touch event */
	virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
	virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent);
	virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent);
	virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent);

	/* Key event */
	virtual void keyBackClicked();
	virtual void keyMenuClicked();

	/* Accelerate event */
	virtual void didAccelerate(CCAcceleration* pAccelerationValue);

	static CCScene* scene();
};

#endif /* GAMESCENE_H_ */
